Method and apparatus for determining the energy of a signal

ABSTRACT

The invention describes two alternative methods and corresponding devices for producing an energy signal y n  whose amplitude values represent the energy of an electrical signal s n . A first method and the corresponding device calculate the energy signal y n  according to the equation  
         y   n     =         tau   ·     s   n   2         2   ·     y     n   -   1           +       (     1   -     tau   2       )     ·     y     n   -   1                         
 
     while a second method and the corresponding device are based on the equation  
         y   n     =       y     n   -   1       +       tau     2        y     n   -   1                (       s   n   2     -     y     n   -   1     2       )                       
 
     where tau is a specified parameter and n represents the clock pulse.

BACKGROUND OF THE INVENTION

[0001] The invention relates generally to the field of signalprocessing, and in particular to the field of channel source audioselection circuitry for an audio signal processor.

[0002] The invention relates to methods and devices for determining theenergy of a signal according to the preambles of method claims 1 and aswell as device claims 4 and 9.

[0003] An ideal exponentially weighted root mean square (erms) detectorfor determining the energy of an analog signal s(u) is well known fromthe theory of electrical signal processing. The energy may be determinedsequentially by executing three method steps: squaring the signal,integrating the squared signal, and extracting the root of theintegrated signal. These method steps are also reflected in thefollowing equation:${y\left( {{s(u)},t} \right)} = \sqrt{\frac{1}{T}{\int_{- \infty}^{t}{{{s^{2}(u)} \cdot e^{- \frac{({t - u})}{T}}}{u}}}}$

[0004] which describes the functional principle of the ideal analogdetector. The detector determines the energy y of the signal s(u) as itsRMS value, weighted exponentially with a time constant T, as a functionof time t.

[0005] The conventional digital ERMS detectors used in practice receivea digital signal s_(n) at their input in order to deliver a digitalenergy signal y_(n) from the output, with the amplitude values of theenergy signal representing the energy of the signal s_(n). They arebased on method steps known from theory. To convert these method steps,as a rule as shown in FIG. 4a, they are formed as a series circuitconsisting of a squaring element 1, a low-pass filter 2, and a rootextractor 3.

[0006]FIG. 4b shows one possible digital implementation for such aseries circuit. Accordingly, squaring element 1 is formed from a firstmultiplying element 410 that multiplies the digital signal s_(n) byitself in order to provide the squared signal s²n and its output. Thesquared signal is then supplied as the input signal to the digitallow-pass 2 weighted with a factor tau.

[0007] Within the low-pass 2, the input signal is fed as a first summandto an adding element 420 which delivers at its output the desired energysignal but squared as y²n. As the second summand, the output signal y²nfed back through a state memory 430 weighted with the factor 1−tau issupplied to adding element 420.

[0008] Then the squared energy signal y²n is subjected by a rootextractor 3 connected downstream to root extraction. The root extractor3 comprises a second adding element 440 that receives the squared energysignal y²n and outputs the desired energy signal y_(n) at its output. Tocalculate the energy signal y_(n), adding element 440 adds the squaredenergy signal to two additional signals. These are firstly the energysignal y_(n-1) fed back through a second state memory 450 from its ownoutput and secondly a signal y² _(n-1) that is obtained by squaring andnegating from the fed-back energy signal y_(n-1).

[0009] The conventional calculation of the energy signal y_(n) shownhere suffers from the following disadvantages:

[0010] By squaring the signal s_(n), its dynamic range is sharplyincreased. It is only possible to store the squared signal in a memorywith a very large word width.

[0011] The square root routines used in conventional extraction ofsquare roots converge slowly, often as a function of the magnitude ofthe amplitude of their input signal. They are therefore unsuitable foruse in systems that require rapid convergence behavior of the detector,such as compander-expander systems for example.

SUMMARY OF THE INVENTION

[0012] The goal of the invention is to improve the methods and devicesaccording to the species for determining the energy of a signal in suchfashion that they exhibit faster convergence behavior and reducedcomputation cost, as well as less storage space.

[0013] This goal is achieved by the method steps claimed in methodclaims 1 and 8, as well as by the features claimed in device claims 4and 9. Additional advantageous embodiments of the invention are thesubjects of the subclaims.

[0014] According to a first embodiment of the method according to theinvention, as shown in independent method claim 1, the goal is achievedespecially by the fact that an energy signal y_(n) is calculated whoseamplitude values represent the energy of signal s_(n), according to theequation $\begin{matrix}{{y_{n} = {\frac{{tau} \cdot s_{n}^{2}}{2 \cdot y_{n - 1}} + {{\left( {1 - \frac{tau}{2}} \right) \cdot y_{n - 1}}\quad \text{with}}}}{\text{tau:~~a specified parameter and}\text{n}\text{:~~~~~the clock pulse, whereby in Equation 1 the method steps of~~~~~~~~squaring, lowpass filtration, and root extraction are combined.}}} & (1)\end{matrix}$

[0015] The parameter tau determines the time constant for theexponential weighting. It bears the following relationship approximatelywith the time constant T in the analog formula (page 3):${tau} = {{0,{5 \cdot \frac{\left( {1 - {e\quad \frac{i}{T \cdot {fs}}}} \right)}{\left( {0,{5 - {e\quad \frac{i}{T \cdot {fs}}}}} \right)}}}}$where: I = sqrt(−1) fs = sampling frequency of the digital system.

[0016] Example:

[0017] with fs=48 kHz and T=20 ms, tau is approximately 0.00104.

[0018] The explanations of the parameters tau and n likewise apply toall the following equations in the specification.

[0019] In the method performed according to Equation 1, the integratedmethod step of extracting the root exhibits a quadratic convergencebehavior which has a very advantageous effect on the dynamic behavior ofthe entire process.

[0020] In addition, the method step of root extraction in the step oflow-pass filtration is integrated, so that the calculation expense isreduced.

[0021] To work the method, it is no longer necessary to store thesquared signal s²n with its large dynamic range; instead, it issufficient to store the amplitude values found for the energy signaly_(n), which, because of the fact that the root has been extracted,exhibit a value range considerably reduced by comparison with thedynamic range of the squared signal s²n. For this reason, in the methodaccording to the invention, a memory with a relatively small word widthcan be used.

[0022] According to one advantageous improvement on the method, thecalculation of the first summand in Equation 1 includes the step“multiply signal s_(n) by an auxiliary signal tau/2y_(n-1) to obtain aproduct signal” and “multiply the product signal by the signal s_(n)” oralternatively the steps “square the signal s_(n) and “multiply thesquared signal s²n by the auxiliary signal tau/2y_(n-1)”. Depending onthe selected implementation of the method, one alternative or the othercan contribute to reducing the computation and storage cost.

[0023] The advantages given for the first embodiment of the methodaccording to the invention apply similarly to a corresponding device.

[0024] It is advantageous for the corresponding device according to theinvention to have an inverter to receive the energy signal y_(n) and tooutput an inverted signal b_(n)=tau/2y_(n), designed so that it, by theequation $\begin{matrix}{b_{n} = {{b_{n - 1} \cdot 2}\quad {\frac{k}{tau} \cdot \left( {\frac{\left( {1 + k} \right) \cdot {tau}}{2k} - \left( {b_{n - 1} \cdot y_{n}} \right)} \right)}}} & (2)\end{matrix}$

[0025] with

[0026] k: a constant preferably between 0.5 and 1, it provides thespecified link between the inverted signal b_(n) and the energy signaly_(n). The convergence behavior of the inverter can be influenced by thechoice of the constant k; in this manner, the quadratic convergencebehavior of the entire device can be optimized as well.

[0027] (Note: the explanation for the constant k likewise applies to allthe following equations in the specification.)

[0028] According to a second embodiment of the method according to theinvention, as shown in the independent method claim 8, the goal isachieved especially by virtue of the fact that the energy signal y_(n)is calculated according to the equation $\begin{matrix}{y_{n} = {y_{n - 1} + {\frac{tau}{2y_{n - 1}}\left( {s_{n}^{2} - y_{n - 1}^{2}} \right)}}} & (3)\end{matrix}$

[0029] with the method steps of squaring, low-pass filtration, and rootextraction being combined in Equation 3.

[0030] In the method performed according to Equation 3, the method stepof root extraction exhibits a quadratic convergence behavior, which hasa highly advantageous effect on the dynamic behavior of the entiremethod.

[0031] In addition, the method step of low-pass filtration is integratedin the step of root extraction, so that calculation cost is reduced.

[0032] To work the method, it is no longer necessary to store thesquared signal s²n with its wide dynamic range; instead, it issufficient to store the currently determined value for the energy signaly_(n), which, because of the root extraction that has been performed,has a value range that is considerably reduced by comparison with thedynamic range of the squared signal s²n. For this reason, in the methodaccording to the invention, a memory with a much reduced word width canbe used.

[0033] The listed advantages of the second embodiment of the methodaccording to the invention also apply to a corresponding device.

[0034] For the device according to the second embodiment, it is likewiseadvantageous for the reasons given for it to have the inverter describedabove.

[0035] These and other objects, features and advantages of the presentinvention will become more apparent in light of the following detaileddescription of preferred embodiments thereof, as illustrated in theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWING

[0036]FIG. 1a is an implementation of a detector according to theinvention according to a first embodiment;

[0037]FIG. 1b is an alternative embodiment of the detector according toFIG. 1a;

[0038]FIG. 2 is an implementation of a detector according to theinvention according to a second embodiment;

[0039]FIG. 3 is an implementation of an inverter according to theinvention;

[0040]FIG. 4a is a block diagram of a conventional detector; and

[0041]FIG. 4b is an implementation of the conventional detector fromFIG. 4a.

DETAILED DESCRIPTION OF THE INVENTION

[0042] A detailed description of the two preferred embodiments of theinvention follow, with reference to FIGS. 1a, 1 b, 2, and 3.

[0043] The first embodiment of a detector according to the invention,shown in FIG. 1a, calculates an energy signal y_(n) whose amplitudevalues represent the energy of the signal s_(n) according to thefollowing equation: $\begin{matrix}{y_{n} = {\frac{{tau} \cdot s_{n}^{2}}{2 \cdot y_{n - 1}} + {\left( {1 - \frac{tau}{2}} \right) \cdot {y_{n - 1}.}}}} & (1)\end{matrix}$

[0044] For hardware or software implementation of Equation 1, thedetector has a first multiplying element 110 and a second multiplyingelement 120, an adding element 130, and a state memory 140.

[0045] The input signal s_(n) is supplied to two inputs of the firstmultiplying element 110 so that the squared input signal s²n isavailable at its output. The squared signal is then fed to the secondmultiplying element 120 that multiplies it by an auxiliary signaltau/2y_(n-1). A product signal calculated by the second multiplyingelement 120 is supplied to a first input of adding element 130, whichprovides the energy signal y_(n) to be determined at its output. Tocalculate the energy signal y_(n), the latter is fed back through statememory 140, weighted with a factor 1−tau/2, to a second input of addingelement 130.

[0046] With the first embodiment of the detector according to theinvention wired in this fashion, a low-pass filter is obtained in whicha root extractor is integrated.

[0047] An alternative design, shown in FIG. 1b, of the first embodimentof the detector differs from the design according to FIG. 1a only in thewiring of the two multipliers 110 and 120. According to the alternativedesign according to FIG. 1b, the multiplying element 110 multiplies thesignal s_(n) initially by the auxiliary signal tau/2y_(n-1). The productsignal at the output of the first multiplying element is then suppliedto multiplying element 120, which multiplies the product signal timesthe signal s_(n).

[0048] In the alternative designs of the detector according to FIGS. 1aand 1 b, the product signals at the outputs of the second multiplier 120are identical.

[0049] According to the second embodiment of the detector according tothe invention shown in FIG. 2, an energy signal y_(n) whose amplitudevalues represent the energy of a signal s_(n) are calculated accordingto the following equation: $\begin{matrix}{y_{n} = {y_{n - 1} + {\frac{tau}{2y_{n - 1}}{\left( {s_{n}^{2} - y_{n - 1}^{2}} \right).}}}} & (3)\end{matrix}$

[0050] For hardware or software implementation of Equation 3, thedetector according to the second embodiment has a first multiplyingelement 210 and a second multiplying element 230, a first adding element220 and a second adding element 240, a state memory 260, and a squaringelement 250.

[0051] The signal s_(n) is supplied to the two inputs of the firstmultiplying element 210, so that the squared signal s²n is provided atthe output of the first multiplying element. The squared signal isdelivered to a first input of the first adding element 220 whose outputsignal is supplied to the second multiplying element 230. The secondmultiplying element 230 multiplies the output signal of the addingelement 220 times the auxiliary signal tau/2y_(n-1) and delivers theresultant product signal to a first input of the second adding element240, which delivers the energy signal y_(n) to be produced at itsoutput. The output signal of adding element 240 is fed back through thestate memory 260 to a second input of the second adding element 240. Inaddition, the output signal y_(n-1) of the state memory 260 is fed backfollowing negation through the squaring element 250 connected downstreamto the second input of the first adding element 220.

[0052] With the second embodiment of the detector according to theinvention wired in this fashion, a root extractor is formed into which alow-pass filter is integrated.

[0053]FIG. 3 shows the implementation of an inverter for converting theenergy signal y_(n) into a signal b_(n)=tau/2y_(n). The inversion takesplace according to the invention by the following equation:$\begin{matrix}{b_{n} = {{b_{n - 1} \cdot 2}\quad {\frac{k}{tau} \cdot {\left( {\frac{\left( {1 + k} \right) \cdot {tau}}{2k} - \left( {b_{n - 1} \cdot y_{n}} \right)} \right).}}}} & (2)\end{matrix}$

[0054] For a hardware or software implementation of Equation 2, theinverter has a first multiplying element 310 and a second multiplyingelement 330, an adding element 320, and a state memory 340.

[0055] The first multiplying element 310 multiplies the received energysignal y_(n) by the output signal b_(n) from the inverter fed back viathe state memory 340. The output signal of the first multiplying element310 is negated and supplied to adding element 320, which adds it to thesummand (1+k)*tau/2k. The sum signal at the output of adding element 320is weighted with the factor 2k/tau and supplied to the secondmultiplying element 330, that multiplies it by the output signal b_(n-1)of the state memory 340. At the output of the second multiplying element330, the output signal b_(n) from the inverter is provided, and suppliedsimultaneously to the state memory 340 as an input signal.

[0056] The following is true of all versions of the erms detector:

[0057] The method supplies inaccurate results if y_(n) suddenly risessharply, so that: y_(n)>c*y_(n-1). Here c is a constant which can bechosen depending on the desired accuracy. A good accuracy is obtainedwith c<1.5.

[0058] In order to improve the accuracy in this case, the followingiterations can be performed as well. This is necessary only with anabrupt change in signal energy and strict requirements for accuracy.This results in the following modification:$y_{n,m} = {{{tau} \cdot \frac{s_{n}^{2}}{{2y_{n,{m - 1}}}\quad}} + {\left( {I - \frac{tau}{2}} \right) \cdot y_{n - 1}}}$and$y_{n,m} = {y_{n - 1} + {\frac{tau}{2y_{n,{m - 1}}}\left( {s_{n}^{2} - y_{n - 1}^{2}} \right)}}$

[0059] where:

[0060] m=additional iteration index.

[0061] The iterations are continued until$\frac{1}{c} < {\frac{y_{n,m}}{y_{n,{m - 1}}}} < c$

[0062] As a rule, even with sharp jumps in the input signals, two tothree iterations will suffice.

[0063] Although the present invention has been shown and described withrespect to several preferred embodiments thereof, various changes,omissions and additions to the form and detail thereof, may be madetherein, without departing from the spirit and scope of the invention.

LIST OF REFERENCE NUMBERS

[0064] energy signal . . . yn

[0065] signal . . . sn

[0066] inverter signal . . . bn

[0067] squaring element . . . 1

[0068] low pass . . . 2

[0069] root extractor . . . 3

[0070] first multiplying element . . . 410

[0071] second multiplying element . . . 440

[0072] adding element . . . 420

[0073] first state memory . . . 430

[0074] second state memory . . . 450

[0075] squaring element . . . 460

[0076] First embodiment of the detector

[0077] first multiplying element . . .110

[0078] second multiplying element . . . 120

[0079] adding element . . . 130

[0080] state memory . . . 140

[0081] Second embodiment of the detector

[0082] first multiplying element . . . 210

[0083] second multiplying element . . . 230

[0084] adding element . . . 220

[0085] state memory . . . 260

[0086] squaring element . . . 250

[0087] Inverter

[0088] first multiplying element . . . 310

[0089] second multiplying element . . . 330

[0090] adding element . . . 320

[0091] state memory . . . 340

What is claimed is:
 1. Method for determining the energy of a signal(s_(n)), comprising the steps of: a) squaring the signal (s_(n)) andproviding a squared signal (s²n) indicative thereof; b) low-passfiltering of said squared signal (s²n) and providing a low-pass-filteredsignal indicative thereof; and c) extracting the root of saidlow-pass-filtered signal to produce an energy signal (y_(n)) whoseamplitude values represent the energy of signal (s_(n)); characterizedin that the energy signal (y_(n)) according to the equation (1)$y_{n} = {\frac{{tau} \cdot s_{n}^{2}}{2 \cdot y_{n - 1}} + {\left( {1 - \frac{tau}{2}} \right) \cdot y_{n - 1}}}$

with tau: a specified parameter and n: the clock pulse is calculatedfrom signal (s_(n)), with the steps a to c being combined into equation(1) and with step (c) of the root extraction being integrated into stepb) of low-pass filtration.
 2. Method according to claim 1, characterizedin that calculation of the first summand comprises the following stepsin equation (1): multiplying the signal (s_(n)) by an auxiliary signal(tau/2y_(n-1)) to produce a product signal; and multiplying the productsignal by the signal (s_(n)).
 3. Method according to claim 1,characterized in that the calculation of the first summand in equation(1) includes the following steps: squaring the signal (s_(n)); andmultiplying the squared signal (s²n) by the auxiliary signal(tau/2y_(n-1)).
 4. A device for determining the energy of a signal(s_(n)), comprising: a squaring element to receive the signal (s_(n))and to output the squared signal (s²n); a low-pass filter for low-passfiltration of the squared signal (s²n); and a root extractor forextracting the root of the low-pass-filtered squared signal andproducing an energy signal (y_(n)) whose amplitude values represent theenergy of signal (s_(n)); characterized in that the device is designedso that it is created by the equation$y_{n} = {\frac{{tau} \cdot s_{n}^{2}}{2 \cdot y_{n - 1}} + {\left( {1 - \frac{tau}{2}} \right) \cdot y_{n - 1}}}$

with tau: a specific parameter and n: the clock pulse, if creates thespecified link between the signal (s_(n)) received by it and the energysignal (y_(n)) output by it, with the link simulating the squaringelement, low-pass filter, and root extractor in such fashion that theroot extractor is integrated into the low-pass filter.
 5. The deviceaccording to claim 4, characterized by a first multiplying element (110)which multiplies the received signal (s_(n)) with an auxiliary signal(tau/2y_(n-1)) and delivers a product signal at its output; and a secondmultiplying element (120) which multiplies the product signal times thesignal (s_(n)).
 6. The device according to claim 4, characterized by afirst multiplying element (110) which squares the received signal(s_(n)) and a second multiplying element (120) that multiplies thesquared signal by an auxiliary signal (tau/2y_(n-1)).
 7. The deviceaccording to claim 4, characterized in that it comprises an inverter forreceiving the energy signal (y_(n)) and for outputting an invertedsignal b_(n)=(tau/2y_(n)), designed so that it creates, by the equation(2)${b_{n} = {{b_{n - 1} \cdot 2}{\frac{k}{tau} \cdot \left( {\frac{\left( {1 + k} \right) \cdot {tau}}{2k} - \left( {b_{n - 1} \cdot y_{n}} \right)} \right)}}},$

where k: a constant between approximately 0.5 and 1, tau: a specificparameter, and n: the clock pulse, creates the specified link betweenthe signal (b_(n)) and the energy signal (y_(n)).
 8. The deviceaccording to claim 5, characterized in that it comprises an inverter forreceiving the energy signal (y_(n)) and for outputting an invertedsignal b_(n)=(tau/2y_(n)), designed so that it creates, by the equation(2)${b_{n} = {{b_{n - 1} \cdot 2}{\frac{k}{tau} \cdot \left( {\frac{\left( {1 + k} \right) \cdot {tau}}{2k} - \left( {b_{n - 1} \cdot y_{n}} \right)} \right)}}},$

where k: a constant between approximately 0.5 and 1, tau: a specificparameter, and n: the clock pulse, creates the specified link betweenthe signal (b_(n)) and the energy signal (y_(n)).
 9. The deviceaccording to claim 6, characterized in that it comprises an inverter forreceiving the energy signal (y_(n)) and for outputting an invertedsignal b_(n)=(tau/2y_(n)), designed so that it creates, by the equation(2)${b_{n} = {{b_{n - 1} \cdot 2}{\frac{k}{tau} \cdot \left( {\frac{\left( {1 + k} \right) \cdot {tau}}{2k} - \left( {b_{n - 1} \cdot y_{n}} \right)} \right)}}},$

where k: a constant between approximately 0.5 and 1, tau: a specificparameter, and n: the clock pulse, creates the specified link betweenthe signal (b_(n)) and the energy signal (y_(n)).
 10. Method fordetermining the energy of a signal (s_(n)), comprising the steps of: a)squaring the signal (s_(n)); b) low-pass filtration of the squaredsignal (s²n); and c) extracting the root of the low-pass-filtered signalfrom step b) to produce an energy signal (y_(n)) whose amplitude valuesrepresent the energy of signal (s_(n)); characterized in that the energysignal (y_(n)) according to the equation (2)$y_{n} = {y_{n - 1} + {\frac{tau}{2y_{n - 1}}\left( {s_{n}^{2} - y_{n - 1}^{2}} \right)}}$

with tau: a specified parameter and n: the clock pulse, is calculatedfrom the signal (s_(n)), with steps a) to c) being combined in equation(2) and the step b) of low-pass filtration being integrated into thestep c) of root extraction.
 11. A device for determining the energy of asignal (s_(n)), comprising: a squaring element to receive signal (s_(n))and to output the squared signal (s²n); a low-pass filter for low-passfiltration of the squared signal (s²n); and a root extractor forextracting the root of the low-pass-filtered squared signal andproducing an energy signal (y_(n)), whose amplitude values represent theenergy of signal (s_(n)); characterized in that the device is designedso that, by the equation (3)$y_{n} = {y_{n - 1} + {\frac{tau}{2y_{n - 1}}\left( {s_{n}^{2} - y_{n - 1}^{2}} \right)}}$

with tau: a specified parameter and n: the clock pulse, creates thespecified link between the signal (s_(n)) received by it and the energysignal (y_(n)) output by it, with the link simulating the squaringelement, low-pass filter, and root extractor in such fashion that thelow-pass filter is integrated in the root extractor.
 12. The deviceaccording to claim 11, characterized in that it has an inverter toreceive energy signal (y_(n)) and to output the signalb_(n)=(tau/2y_(n)) designed so that the equation (2)${b_{n} = {{b_{n - 1} \cdot 2}{\frac{k}{tau} \cdot \left( {\frac{\left( {1 + k} \right) \cdot {tau}}{2k} - \left( {b_{n - 1} \cdot y_{n}} \right)} \right)}}},$

with k: a constant between approximately 0.5 and 1, tau: a specifiedparameter, and n: the clock pulse for calculating the signals, itcreates the specified link between signal b_(n) and energy signal(y_(n)).